package com.edu.d1_set;

import java.util.HashSet;

public class SetDemo3 {
    /**
     * 学习Set集合去重复原理
     */
    public static void main(String[] args) {
        HashSet<Student> hashSet = new HashSet<>();
        Student s1=new Student("坤坤",20,'男');
        Student s2=new Student("坤坤",20,'男');
        Student s3=new Student("坤坤",20,'男');
        Student s4=new Student("坤坤",20,'男');
        Student s5=new Student("坤坤",20,'男');
        Student s6=new Student("陈鑫",22,'女');
        hashSet.add(s1);
        hashSet.add(s2);
        hashSet.add(s3);
        hashSet.add(s4);
        hashSet.add(s5);
        hashSet.add(s6);
        System.out.println(hashSet);
    }
}
